package com.jumi.microservice.utils;

import com.jumi.microservice.common.utils.ObjectUtils;
import com.jumi.microservice.constant.ExceptionEnum;
import com.jumi.microservice.domain.Log;
import com.jumi.microservice.domain.LogDetailVO;

import java.util.List;

/**
 * - - - - - - - - - - - - - - -
 *
 * @author liuz
 * @date 2020/10/14 16:44
 * ToDoSomeThing
 * - - - - - - - - - - - - - - -
 */
public class LogObjectCopyUtil {

    /**
     * 将操作日志DO对象集合转换为VO对象集合
     *
     * @param logs 账号登录日志DO 集合
     * @return List<LogDetailVO> 操作日志VO对象集合
     */
    public static List<LogDetailVO> convertOperateLogDoList2VoList(List<Log> logs) {
        List<LogDetailVO> logVoList = null;
        try {
            logVoList = ObjectUtils.convertList(logs, LogDetailVO.class);
        } catch (Exception e) {
            ExceptionEnum.FAIL_CHANGE.newException();
        }
        return logVoList;
    }

}
